<template>
  <div id="app">
    <v-header :seller="seller"></v-header>
    <div class="tab">
      <div class="tab-wrapper select">
        <router-link to="/">商品</router-link>
      </div>
      <div class="tab-wrapper">
        <router-link to="/comment">评论</router-link>
      </div>
      <div class="tab-wrapper">
        <router-link to="/seller">商家</router-link>
      </div>
    </div>
    <router-view></router-view>
  </div>
</template>

<script>
import header from "@/components/v-header/v-header.vue";
import { getSeller } from "@/api";

export default {
  data() {
    return {
      seller: {},
    };
  },
  components: {
    "v-header": header,
  },
  created() {
    getSeller().then((res) => {
      this.seller = res;
    });
  },
};
</script>

<style lang="less">
* {
  margin: 0;
  padding: 0;
}
a {
  text-decoration: none;
  color: #666;
}
.tab {
  width: 100%;
  background: #fff;
  height: 36px;
  display: flex;
  .tab-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    a {
      height: 100%;
      display: inline-block;
      width: 100%;
      text-align: center;
      line-height: 36px;
    }
    .router-link-exact-active {
      color: #f01414;
      border-bottom: 2px solid #f01414;
    }
  }
}
</style>
